package com.woniuxy.mapper;

import com.woniuxy.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface UserMapper {
    void insert(User user);
    @Select("SELECT * FROM user WHERE account = #{account} OR email = #{email}")
    User findByAccountOrEmail(User user);


    void updateByUserId(User user);

    @Update("UPDATE user SET img = #{url} WHERE user_id = #{userId}")
    void updateAvatar(@Param("url") String url,@Param("userId") Integer userId);

    @Update("UPDATE user SET password = #{password} WHERE user_id = #{userId}")
    void updatePassword(User user);
}
